﻿//
// GNS_HallScene.cpp
// MobileManageSys
//FuncTion 主页面场景
// Created by mr.l on 16/1/12.
//
//
#include "GnsClientFrame.h"
#include "IEventBridge.h"
#include "GNS_HallScene.h"
#include "cocostudio/CocoStudio.h"
#include "ui/CocosGUI.h"
#include "GNS_Common.h"
#include "GNS_PlayerMgr.h"
#include "GNS_SceneMgr.h"
#include "GNS_Calendar.h"
#include "GnsOften.h"

USING_NS_CC;
using namespace cocostudio::timeline;
using namespace ui;
#define winsize Director::getInstance()->getVisibleSize()

//extern ISocketMgr * _GameSock;

GNS_HallScene::GNS_HallScene()
{
    rootNode=0;
    SystemLayer=0;
    PlayerLayer=0;
    RevenuReport=0;
    Promoter=0;
    NullNode=0;
    SysteManage=0;//管理系统
    Promoters=0;//推广人员
    Player=0;//直属玩家
    RevenueReport=0;//营收报告
    PassWordLayer=0;
    pApplyTopUp=0;
    pUserInfo=nullptr;
    pApplyTick=0;
    pPlayerTopPro=0;
    pPromoterPro=0;
    pPlayerCritValue=0;
    pUserTopUpLayer=0;
    pGameDow=0;
    pManageRec=0;
    pTopAndTick=0;
    pAccounter=0;
    pNewPromoter=0;
    pPlayerDate=0;
    pPvpApplyTick=0;
    pPvEAllDate=0;
    pPvEAllInfo=0;
    pDailyTop=0;
    pDailyTick=0;
    pDailyTransfer=0;
    IDTextField=nullptr;
    pTypeList=nullptr;
    Exchtext=nullptr;
    pSptbg=nullptr;
    IsShowPlayBg=false;
    year=0;
    Mon=0;
    day=0;
    Exclamation=nullptr;
    pListView=nullptr;
    UersType=0;
	pInfoMakeLayer = nullptr;
	flag = false;

	_IDTextField = nullptr;
}

GNS_HallScene::~GNS_HallScene()
{
	
}

Scene* GNS_HallScene::createScene()
{
    auto scene = Scene::create();
    GNS_SceneMgr::getInstance()->AddSceneLayer(HALL_LAYER);
    auto layer = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
    scene->addChild(layer);
    return scene;
}

bool GNS_HallScene::init()
{
    if ( !Layer::init() )
    {
        return false;
    }

	auto pCalendar = GNS_Calendar::create();
	GNS_SceneMgr::getInstance()->setCalendar(pCalendar);
	pCalendar->setVisible(false);
	pCalendar->retain();


	rootNode = CSLoader::createNode("HallScene.csb");
	rootNode->setContentSize(winsize);
	ui::Helper::doLayout(rootNode);
	addChild(rootNode);

	//系统管理csb
	SystemLayer = CSLoader::createNode("SystemLayer.csb");
	SystemLayer->setContentSize(winsize);
	ui::Helper::doLayout(SystemLayer);
	addChild(SystemLayer);

	ObtainRef();

	initData();

	if (SysteManage != nullptr)
		SysteManage->setBrightStyle(ui::Widget::BrightStyle::HIGHLIGHT);

    return true;
}

// 进入场景后，要初始化内容
void GNS_HallScene::onEnterTransitionDidFinish()
{
	// 事件桥梁定时器
	this->schedule(schedule_selector(GNS_HallScene::onEventBridge), 0.08f);
}

// 离开场景前，要释放内容
void GNS_HallScene::onExitTransitionDidStart()
{
	// 杀掉事件桥梁定时器
	this->unschedule(schedule_selector(GNS_HallScene::onEventBridge));
}

void GNS_HallScene::initData()
{
    
    SysteManage = static_cast<Button *>(rootNode->getChildByName("SysteManage"));
    SysteManage->setTag(SYSTEM);
    SysteManage->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::BtnCallBack, this));
    
    Promoters =static_cast<Button*>(rootNode->getChildByName("Promoters"));
    Promoters->setTag(PROMOTERS);
    Promoters->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::BtnCallBack, this));
    
    if(GNS_PlayerMgr::getInstance()->getUserLevel()==0)
    {
        Promoters->loadTextureNormal("agency_gray.png");
        Promoters->loadTexturePressed("agency_blue.png");
        
    }
    
    Player =static_cast<Button*>(rootNode->getChildByName("Player"));
    Player->setTag(PLAYER);
    Player->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::BtnCallBack, this));
    
    RevenueReport=static_cast<Button*>(rootNode->getChildByName("RevenueReport"));
    RevenueReport->setTag(REVENUEReport);
    RevenueReport->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::BtnCallBack,this));
    
    Promoter =CSLoader::createNode("PromotersLayer.csb");
    Promoter->setContentSize(winsize);
    Promoter->setVisible(false);
    ui::Helper::doLayout(Promoter);
    addChild(Promoter);
    
    PlayerLayer = CSLoader::createNode("PlayerLayer.csb");
    PlayerLayer->setContentSize(winsize);
    ui::Helper::doLayout(PlayerLayer);
    addChild(PlayerLayer);
    PlayerLayer->setVisible(false);
    
    RevenuReport=CSLoader::createNode("RevenueReportLayer.csb");
    RevenuReport->setContentSize(winsize);
    ui::Helper::doLayout(RevenuReport);
    RevenuReport->setVisible(false);
    addChild(RevenuReport);

    //GNS_PlayerMgr::getInstance()->_NodeHallVec.pushBack(SystemLayer);
    //GNS_PlayerMgr::getInstance()->_NodeHallVec.pushBack(Promoter);
    //GNS_PlayerMgr::getInstance()->_NodeHallVec.pushBack(PlayerLayer);
    //GNS_PlayerMgr::getInstance()->_NodeHallVec.pushBack(RevenuReport);

	GNS_NodeMgr::getInstance()->pushMenuNode("SystemMgr",SystemLayer);
	GNS_NodeMgr::getInstance()->pushMenuNode("Promoter", Promoter);
	GNS_NodeMgr::getInstance()->pushMenuNode("Player", PlayerLayer);
	GNS_NodeMgr::getInstance()->pushMenuNode("RevRep", RevenuReport);

    UersType =GNS_PlayerMgr::getInstance()->getUserLevel();

	time_t tt;
	time(&tt);
	struct tm * time;
	time = localtime(&tt);

	/*SYSTEMTIME st;
	GetLocalTime(&st);
	log("%d-%02d-%02d %02d:%02d:%02d\n", st.wYear, st.wMonth, st.wDay, st.wHour, st.wMinute, st.wSecond);*/

	Mon = (int)time->tm_mon + 1;
	year = time->tm_year + 1900;
	day = (int)time->tm_mday;
    
    //加载遮罩
    //auto pMakeLayer = GNS_MakeLayer::CreateMakeLayer("加载中...");
    //pMakeLayer->AutoClose(2.0f);
    //this->addChild(pMakeLayer);
}
void GNS_HallScene::SetButtonState()
{
    SysteManage->setBrightStyle(ui::Widget::BrightStyle::NORMAL);
    Promoters->setBrightStyle(ui::Widget::BrightStyle::NORMAL);
    Player->setBrightStyle(ui::Widget::BrightStyle::NORMAL);
    RevenueReport->setBrightStyle(ui::Widget::BrightStyle::NORMAL);
    
}
void GNS_HallScene::BtnCallBack(cocos2d::Ref *pSender, ui::Widget::TouchEventType type){
    if (type==ui::Widget::TouchEventType::ENDED) {
        auto pButton = (Button*)pSender;
        int BtnTag = pButton->getTag();
        switch (BtnTag) {
            case SYSTEM:
            {
                SetButtonState();
                pButton->setBrightStyle(ui::Widget::BrightStyle::HIGHLIGHT);
                NodeChoose(SystemLayer);
                break;
            }
            case PROMOTERS:
            {
                if (UersType==2) {
                    auto pPopWnd = PopWndLayer::createScene("Popwnd.png", "PageClose.png");
                    pPopWnd->setClickWndOutsideClose(true);
                    pPopWnd->SetTitleWithUTF("提示!");
                    pPopWnd->SetContentTextWithUTF("您没有直属推广员", Color3B::BLACK);
                }else{
                    SetButtonState();
                    pButton->setBrightStyle(ui::Widget::BrightStyle::HIGHLIGHT);
                    NodeChoose(Promoter);
                    ObtainPromter();
                    auto NewAgent = static_cast<Button *>(Promoter->getChildByName("NewAgent"));
                        NewAgent->setVisible(false);
                }
                break;
            }
            case PLAYER:
            {
                if (UersType!=2) {
                    auto pPopWnd = PopWndLayer::createScene("Popwnd.png", "PageClose.png");
                    pPopWnd->setClickWndOutsideClose(true);
                    pPopWnd->SetTitleWithUTF("提示!");
                    pPopWnd->SetContentTextWithUTF("您没有直属玩家", Color3B::BLACK);
                }else{
                    SetButtonState();
                    pButton->setBrightStyle(ui::Widget::BrightStyle::HIGHLIGHT);
                    NodeChoose(PlayerLayer);
                    if (NumPlayer==0) {
                        ObtainPlayer();
                        NumPlayer=1;
                    }
                    
                    GNS_PlayerMgr::getInstance()->getLowlineInfo()->clear();
                    _LowlineInfo.clear();
                    log("%zd",GNS_PlayerMgr::getInstance()->getLowlineInfo()->size());
                    CMD_CS_GetLowlineUserInfo pLowLineInfo;
                    pLowLineInfo._agentCode=(int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                    GnsClientFrame::getInstance()->sendMsg(0,MAIN_MSG_LOGIN, SUB_CS_GET_LOWLINE_USER_EXCHANGE_INFO,(char*) &pLowLineInfo, sizeof(pLowLineInfo));
                }
                break;
            }
            case REVENUEReport:
            {
                SetButtonState();
                pButton->setBrightStyle(ui::Widget::BrightStyle::HIGHLIGHT);
                NodeChoose(RevenuReport);
                ObtainRevRep();
                break;
            }
            default:
                break;
        }
    }
}
// 管理系统按钮事件
void GNS_HallScene::SysteBtnCallBack(cocos2d::Ref *pSender, ui::Widget::TouchEventType type)
{
    if (type==ui::Widget::TouchEventType::ENDED) 
	{
        auto pButton = (Button *)pSender;
        int BtnTag = pButton->getTag();
        switch (BtnTag)
		{
            case SYSTEM_CALLBACK:
            {
               //NodeChoose(NullNode);
                //_GameSock->closeConnection();
                GnsClientFrame::getInstance()->closeSocket(0);
                GNS_PlayerMgr::getInstance()->ClearAllVectorDate();
                GNS_SceneMgr::getInstance()->replaceScene(LOGIN_SCENE);

                break;
            }
            case SYSTEM_USERINFOR:
            {
				//add by jack 请求用户信息
				CMD_CS_GetMobileUserinfo info;
				info._agentCode = (int)GNS_PlayerMgr::getInstance()->getMyUseridx();
				GnsClientFrame::getInstance()->sendMsg(0, MAIN_MSG_LOGIN, SUB_CS_USER_GETUSERINFO, (char*)&info, sizeof(info));
				//增加遮罩显示正在获取数据
				/*if (pInfoMakeLayer == nullptr)
				{
				pInfoMakeLayer = GNS_MakeLayer::CreateMakeLayer("获取数据中...");
				addMakerLayer();
				}
				*/
				/*NodeChoose(NullNode);
				pUserInfo = GNS_PopWndUserInfo::createLayer();
				pUserInfo->SetNodeName("UserInfoLayer.csb");
				pUserInfo->UserInfoDate(GNS_PlayerMgr::getInstance()->pGetUserInfoResult);*/
                break;
            }
            case SYSTEM_PASSWORLD:
            {
                NodeChoose(NullNode);
                PassWordLayer = GNS_PopWndPassWord::createLayer();
                PassWordLayer->SetNodeName("PassWordLayer.csb");

                break;
            }
            case SYSTEM_APPLYTOU:
            {
                NodeChoose(NullNode);
                pApplyTopUp = GNS_ApplyTopUp::createLayer();
                pApplyTopUp->SetNodeName("ApplyTouUpayer.csb");
                break;
            }
            case SYSTEM_APPLYTICKET:
            {
                int Level=GNS_PlayerMgr::getInstance()->getUserLevel();
                if (Level==0) {
                    auto pPopWnd = PopWndLayer::createScene("Popwnd.png", "PageClose.png");
                    pPopWnd->setClickWndOutsideClose(true);
                    pPopWnd->SetTitleWithUTF("提示!");
                    pPopWnd->SetContentTextWithUTF("运营商不能申请兑奖", Color3B::BLACK);
                    //pPopWnd->PopWndEffectseffects("RunCircle.plist",true);
                }else{
                    NodeChoose(NullNode);
                    pApplyTick = GNS_ApplyTick::createLayer();
                   // Director::getInstance()->replaceScene(pApplyTick->createScene());
                    pApplyTick->SetNodeName("ApplyTickLayer.csb");
                }
                break;
            }
            case SYSTEM_PLAYERTOPRO:
            {
                NodeChoose(NullNode);
                pPlayerTopPro = GNS_PlayerTopPro::createLayer();
                pPlayerTopPro->SetNodeName("PlayerTopProLayer.csb");
                break;
            }
            case SYSTEM_PROMOTERTOPRO:  //推广员充值比入口
            {
                int Level=GNS_PlayerMgr::getInstance()->getUserLevel();
                if (Level==0) {
                    auto pPopWnd = PopWndLayer::createScene("Popwnd.png", "PageClose.png");
                    pPopWnd->setClickWndOutsideClose(true);
                    pPopWnd->SetTitleWithUTF("提示!");
                    pPopWnd->SetContentTextWithUTF("运营商不能设置推广员充值比例", Color3B::BLACK);
                   // pPopWnd->PopWndEffectseffects("RunCircle.plist",true);
                }else if(Level==2){
                    auto pPopWnd = PopWndLayer::createScene("Popwnd.png", "PageClose.png");
                    pPopWnd->setClickWndOutsideClose(true);
                    pPopWnd->SetTitleWithUTF("提示!");
                    pPopWnd->SetContentTextWithUTF("推广员不能设置推广员充值比例", Color3B::BLACK);
                    //pPopWnd->PopWndEffectseffects("RunCircle.plist",true);
                }else{
                NodeChoose(NullNode);
                pPromoterPro = GNS_PromoterPro::createLayer();
                pPromoterPro->SetNodeName("PromoterTopLayer.csb");
                int RechargeRatio = GNS_PlayerMgr::getInstance()->getAgRation()->at(0)._lowlineRechargeRatio;
				//pPromoterPro->SetInputStr(StringUtils::format("%d", RechargeRatio));
				pPromoterPro->setRechargeRatio(RechargeRatio);
                }
                break;
            }
            case SYSTEM_PLAYERCRITVALUE:
            {
                NodeChoose(NullNode);
                pPlayerCritValue = GNS_PlayerCritValue::createLayer();
                pPlayerCritValue->SetNodeName("PlayerCritValueLayer.csb");
                break;
            }
            case SYSTEM_USERTOP:
            {
                NodeChoose(NullNode);
                pUserTopUpLayer = GNS_UserTopUp::createLayer();
                pUserTopUpLayer->SetNodeName("UserTopUp.csb");
                GNS_PlayerMgr::getInstance()->getUserInfo()->clear();
                CMD_CS_GetUserExchangeInfo pUserExchangelnfo;
                pUserExchangelnfo._agentCode = (int)GNS_PlayerMgr::getInstance()->getMyUseridx();
				std::string SentDate = StringUtils::format("%d-%02d-%02d", year, Mon, day);
				memcpy(pUserExchangelnfo._selDate, SentDate.c_str(), 11);
                GnsClientFrame::getInstance()->sendMsg(0,MAIN_MSG_LOGIN, SUB_CS_GET_USER_EXCHANGE_INFO, (char*)&pUserExchangelnfo, sizeof(pUserExchangelnfo));
                break;
            }
            case SYSTEM_GAMEDOWN:
            {
                NodeChoose(NullNode);
                pGameDow = GNS_GameDown::createLayer();
                pGameDow->SetNodeName("GameDownLayer.csb");
                
                GNS_PlayerMgr::getInstance()->getGameDown()->clear();
                CMD_CS_GetGameDownLoadURL pGetGameDown;
                pGetGameDown.iUserID=(int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                pGetGameDown.iGameID=0;
                GnsClientFrame::getInstance()->sendMsg(0,MAIN_MSG_LOGIN, SUB_CS_GAME_DOWNLOAD_URL, (char*)&pGetGameDown, sizeof(pGetGameDown));
                break;
            }
            case SYSTEM_MANAGEREC:
            {
                NodeChoose(NullNode);
                pManageRec = GNS_ManageRecord::createLayer();
                pManageRec->SetNodeName("ManageRecLayer.csb");
                
                GNS_PlayerMgr::getInstance()->getUserManage()->clear();
                CMD_CS_GetAgentUserManageLog pUserManageLog;
                pUserManageLog.iUserID = (int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                std::string SentDate = StringUtils::format("%d-%02d-%02d",year,Mon,day);
                memcpy(pUserManageLog.szLogTime, SentDate.c_str(), SentDate.length() + 1);
                GnsClientFrame::getInstance()->sendMsg(0,MAIN_MSG_LOGIN, SUB_CS_AGENT_MANAGE_LOG, (char*)&pUserManageLog, sizeof(pUserManageLog));
                break;
            }
            default:
                break;
        }
    }

}

void GNS_HallScene::RefreshManage(float dt)
{
	auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
	if (GNS_PlayerMgr::getInstance()->getUserNotInfo()->size() == 0 && GNS_PlayerMgr::getInstance()->getUserFailExInfo()->size() == 0)
	{
		updateRefresh(false);
	}
	else
	{
		updateRefresh(true);
	}
}

void GNS_HallScene::AddUserInfo(CMD_SC_GetMobileUserinfoResult*pDate)
{
    pUserInfo = GNS_PopWndUserInfo::createLayer();
    pUserInfo->SetNodeName("UserInfoLayer.csb");
    pUserInfo->UserInfoDate(*pDate);
}


//推广员按钮事件
void GNS_HallScene::PromoterBtnCallBack(cocos2d::Ref *pSender, ui::Widget::TouchEventType type)
{
    if (type==ui::Widget::TouchEventType::ENDED) {
        auto pButton = (Button *)pSender;
        int BtnTag = pButton->getTag();
        NodeChoose(NullNode);
        switch (BtnTag) {
            case PROMOTER_TOPANDTICK:
            {

                pTopAndTick=GNS_TopAndTick::createLayer();
                pTopAndTick->SetNodeName("TopAndTickLayer.csb");
                GNS_PlayerMgr::getInstance()->getExListRes()->clear();
                
                CMD_CS_GetExchangeList pExList;
                pExList._agentCode=(int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                GnsClientFrame::getInstance()->sendMsg(0,MAIN_MSG_LOGIN, SUB_CS_GET_LOWLINE_EXCHANGE_INFO,(char*) &pExList, sizeof(pExList));
                break;
            }
            case PROMOTER_ACC:
            {
                pAccounter=GNS_Accounted::createLayer();
                pAccounter->SetNodeName("AccountedLayer.csb");
                
                GNS_PlayerMgr::getInstance()->getAgProPer()->clear();
                GNS_PlayerMgr::getInstance()->getOperatorAgProPer()->clear();
                CMD_CS_GetAgentProfitPercent  pGetAgFitPer;
                pGetAgFitPer._agentCode=(int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                GnsClientFrame::getInstance()->sendMsg(0,MAIN_MSG_LOGIN, SUB_CS_GET_CURRENT_AGENT_PERCENT, (char*)&pGetAgFitPer, sizeof(pGetAgFitPer));
                break;
            }
            case PROMOTER_NEW:
            {
                pNewPromoter = GNS_NewPromoter::createLayer();
                pNewPromoter->SetNodeName("NewPromoter.csb");
                break;
            }
            default:
                break;
        }
    }
}
void GNS_HallScene::PlayerBtnCallBack(cocos2d::Ref *pSender, ui::Widget::TouchEventType type)
{
    if (type==ui::Widget::TouchEventType::ENDED) {
        auto pButton = (Button *)pSender;
        int BtnTag = pButton->getTag();
        switch (BtnTag) {
            case PLAYER_DATE:
            {
                
            }
                break;
            case 301:
            {
              
                if (pSptbg->isVisible()==true) {
                    std::string TypeName = pButton->getTitleText();
                    Exchtext->setString(TypeName);
                    pSptbg->setVisible(false);
					
					if (PlayerLayer->getChildByTag(302) != nullptr)
						PlayerLayer->removeChildByTag(302);
					//setSwallowsTouches(false);

                    IsShowPlayBg=false;
                    if (TypeName=="充兑") {
                          _LowlineInfo.clear();
                        Text_9->setString("充值");
                        Text_9_0->setString("兑奖");
                        for (auto it:*GNS_PlayerMgr::getInstance()->getLowlineInfo()) {
                            if (it._isSupportType==0||it._isSupportType==1) {
                                _LowlineInfo.push_back(it);
                            }
                        }
						PlayerShowDate();
                    }else{
                        _LowlineInfo.clear();
                        Text_9->setString("转入");
                        Text_9_0->setString("转出");
                        for (auto it:*GNS_PlayerMgr::getInstance()->getLowlineInfo()) {
                            if (it._isSupportType==0||it._isSupportType==2) {
                                _LowlineInfo.push_back(it);
                            }
                        }                 
						PlayerShowDate(1);
                    }
                    
                }else{
                    pSptbg->setVisible(true);
                    IsShowPlayBg=true;
                }
                break;
            }
            case 303:
            {
                if (IsShowPlayBg==false) {
                    auto pImageView2 =static_cast<ImageView *>(PlayerLayer->getChildByName("Image_6"));
                    std::vector<std::string >_DateStr;
                    _DateStr.push_back("充兑");
                    _DateStr.push_back("转账");
                    
                    pSptbg = Sprite::create("drop.png");

					auto dispatcher = Director::getInstance()->getEventDispatcher();
					auto listener = EventListenerTouchOneByOne::create();
					listener->onTouchBegan = [](Touch *, Event *){return true; };
					listener->onTouchEnded = [](Touch *, Event *){return; };
					listener->setSwallowTouches(true);//true不向下传递触摸,false向下传递触摸
					dispatcher->addEventListenerWithSceneGraphPriority(listener, pSptbg);

                    pSptbg->setPosition(Vec2(pImageView2->getPositionX()-20, pImageView2->getPositionY()-pImageView2->getContentSize().height-pSptbg->getContentSize().height/2-70));
                    pSptbg->setContentSize(Size(100,25*_DateStr.size()));
                    PlayerLayer->addChild(pSptbg,11,302);
                    
                    for (int i=0; i<_DateStr.size(); i++) {
                        auto pButton =Button::create();
                        pButton->setTitleText(_DateStr.at(i));
                        pButton->setTitleFontSize(24);
                        pButton->setColor(Color3B::BLACK);
                        pButton->setTag(301);
                        pButton->setPosition(Vec2(50, 200-(i*50)));
                        pButton->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::PlayerBtnCallBack, this));
                        pSptbg->addChild(pButton);
                    }
					pSptbg->setVisible(true);
                    IsShowPlayBg=true;
                }else{
                    pSptbg->setVisible(false);
                    IsShowPlayBg=false;
                }
                break;
            }
            case 304:
            {
                //  搜索响应的事件

				playerSearchFunc();

                break;
            }
            default:
                break;
        }
    }
}
void GNS_HallScene::ReveBtnCallBack(cocos2d::Ref *pSender, ui::Widget::TouchEventType type)
{
    if (type==ui::Widget::TouchEventType::ENDED) {
        auto pButton = (Button *)pSender;
        int BtnTag = pButton->getTag();
        NodeChoose(NullNode);
        switch (BtnTag) {
            case REVREP_PVP:  //人人对战税收分成入口
            {
                pPvpApplyTick = GNS_PvpApplyTick::createLayer();
                pPvpApplyTick->SetNodeName("PvPApplyTick.csb");
                
                GNS_PlayerMgr::getInstance()->getGameReveRes()->clear();
                CMD_CS_GetManToManGameRevenue  pGetGameReven;
                pGetGameReven._agentCode=(int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                pGetGameReven._uplineCode=(int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                if(GNS_PlayerMgr::getInstance()->getGameList()->size()!=0)
                {
                    for (auto it:(*GNS_PlayerMgr::getInstance()->getGameList())) {
                        if (it.iGameType==2) {
                            pGetGameReven._gameId=it.nGameId;
                            break;
                        }
                    }
                }
                if (GNS_PlayerMgr::getInstance()->getUserLevel()==2) {
                    pGetGameReven._type=3;
                }else{
                    pGetGameReven._type=0;
                }
                std::string TimeDate = StringUtils::format("%d-%02d-%02d",year,Mon,day);
                memcpy(pGetGameReven._selDate, TimeDate.c_str(), 11);
                GNS_PlayerMgr::getInstance()->setGameId(pGetGameReven._gameId);
                GnsClientFrame::getInstance()->sendMsg(0,MAIN_MSG_LOGIN, SUB_CS_GET_MANTOMAN_GAME_REVENUE, (char*)&pGetGameReven, sizeof(pGetGameReven));
                break;
            }
            case REVREP_PVE:
            {
                pPvEAllDate = GNS_PvEAllDate::createLayer();
                pPvEAllDate->SetNodeName("PvEAllDate.csb");
                
                GNS_PlayerMgr::getInstance()->getPlayProFit()->clear();
                CMD_CS_GetManToMachPlayProfit pGetPlayPro;
                pGetPlayPro._agentCode=(int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                pGetPlayPro._uplineCode=(int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                if (GNS_PlayerMgr::getInstance()->getGameList()->size()!=0) {
                    for (auto it:(*GNS_PlayerMgr::getInstance()->getGameList())) {
                        if (it.iGameType==1) {
                            pGetPlayPro._gameId=it.nGameId;
							break;
                        }
                    }
                }
                if(GNS_PlayerMgr::getInstance()->getUserLevel()==2)
                {
                    pGetPlayPro._type=3;
                }else{
                    pGetPlayPro._type=0;
                }
                std::string TimeDate = StringUtils::format("%d-%02d-%02d",year,Mon,day);
                memcpy(pGetPlayPro._selDate, TimeDate.c_str(), 11);
                GnsClientFrame::getInstance()->sendMsg(0,MAIN_MSG_LOGIN, SUB_CS_GET_MANTOMACH_GAME_PROFIT, (char*)&pGetPlayPro, sizeof(pGetPlayPro));
				GNS_PlayerMgr::getInstance()->setGameId(pGetPlayPro._gameId);
                break;
            }
            case REVREP_PVE_INTO:
            {
                pPvEAllInfo = GNS_PvEAllInfo::createLayer();
                pPvEAllInfo->SetNodeName("PvEAllInfo.csb");
                
                
                GNS_PlayerMgr::getInstance()->getPlayProRation()->clear();
                CMD_CS_GetManToMachPlayProfitRatio pGetPlayPro;
                pGetPlayPro._agentCode=(int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                pGetPlayPro._uplineCode=(int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                if (GNS_PlayerMgr::getInstance()->getGameList()->size()!=0) {
                    for (auto it:(*GNS_PlayerMgr::getInstance()->getGameList())) {
                        if (it.iGameType==1) {
                            pGetPlayPro._gameId=it.nGameId;
							break;
                        }
                    }
                }
                pGetPlayPro._type=GNS_PlayerMgr::getInstance()->getUserLevel()+1;
                std::string SentDate = StringUtils::format("%d-%02d-%02d",year,Mon,day);
                memcpy(pGetPlayPro._selDate, SentDate.c_str(), 11);
                GnsClientFrame::getInstance()->sendMsg(0,MAIN_MSG_LOGIN, SUB_CS_GET_MANTOMACH_GAME_PROFIT_RATIO, (char*)&pGetPlayPro, sizeof(pGetPlayPro));
				GNS_PlayerMgr::getInstance()->setGameId(pGetPlayPro._gameId);
                break;
            }
            case REVREP_TOP:
            {
                pDailyTop = GNS_DailyTop::createLayer();
                pDailyTop->SetNodeName("DailyTop.csb");
                GNS_PlayerMgr::getInstance()->InfoResult_operType=1;
                GNS_PlayerMgr::getInstance()->getDialyToInfo()->clear();
                CMD_CS_GetDialyExchangeInfo pGetDialyInfo;
                pGetDialyInfo._agentCode=(int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                pGetDialyInfo._type = GNS_PlayerMgr::getInstance()->getUserLevel();
                pGetDialyInfo._operType=1;
                 std::string TimeDate = StringUtils::format("%d-%02d-%02d",year,Mon,day);
                memcpy(pGetDialyInfo._selDate, TimeDate.c_str(), 11);
                GnsClientFrame::getInstance()->sendMsg(0,MAIN_MSG_LOGIN, SUB_CS_GET_DIALY_EXCHANGE_INFO, (char*)&pGetDialyInfo, sizeof(pGetDialyInfo));
                break;
            }
            case REVREP_TICK:
            {
                pDailyTick = GNS_DailyTick::createLayer();
                pDailyTick->SetNodeName("DailyTick.csb");
                GNS_PlayerMgr::getInstance()->InfoResult_operType=2;
                GNS_PlayerMgr::getInstance()->getDialyTiInfo()->clear();
                CMD_CS_GetDialyExchangeInfo pGetDialyInfo;
                pGetDialyInfo._agentCode=(int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                pGetDialyInfo._type = GNS_PlayerMgr::getInstance()->getUserLevel();
                pGetDialyInfo._operType=2;
                pGetDialyInfo._type = GNS_PlayerMgr::getInstance()->getUserLevel();
                std::string TimeDate = StringUtils::format("%d-%02d-%02d",year,Mon,day);
                memcpy(pGetDialyInfo._selDate, TimeDate.c_str(), 11);
                GnsClientFrame::getInstance()->sendMsg(0,MAIN_MSG_LOGIN, SUB_CS_GET_DIALY_EXCHANGE_INFO, (char*)&pGetDialyInfo, sizeof(pGetDialyInfo));
                break;
            }
            case REVREP_TRANSFER:
            {
                pDailyTransfer = GNS_DailyTransfer::createLayer();
                pDailyTransfer->SetNodeName("DailyTransfer.csb");
                GNS_PlayerMgr::getInstance()->InfoResult_operType=3;
                GNS_PlayerMgr::getInstance()->getDialyTrInfo()->clear();
                CMD_CS_GetDialyExchangeInfo pGetDialyInfo;
                pGetDialyInfo._agentCode=(int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                pGetDialyInfo._type = GNS_PlayerMgr::getInstance()->getUserLevel();
                pGetDialyInfo._operType=3;
                std::string TimeDate = StringUtils::format("%d-%02d-%02d",year,Mon,day);
                memcpy(pGetDialyInfo._selDate, TimeDate.c_str(), 11);
               GnsClientFrame::getInstance()->sendMsg(0,MAIN_MSG_LOGIN, SUB_CS_GET_DIALY_EXCHANGE_INFO, (char*)&pGetDialyInfo, sizeof(pGetDialyInfo));
                break;
            }
            default:
                break;
        }
    }
}
void GNS_HallScene::NodeChoose(cocos2d::Node *pNode)
{
        Vector<Node*>::iterator iter;
        iter=GNS_PlayerMgr::getInstance()->_NodeChildVec.begin();
        while ( 0 != GNS_PlayerMgr::getInstance()->_NodeChildVec.size())
        {
            Node * pNode = (Node*)(*iter);
            pNode->removeAllChildrenWithCleanup(true);
            this->removeChild(pNode,true);
            GNS_PlayerMgr::getInstance()->_NodeChildVec.erase(iter);
            //pNode->removeAllChildrenWithCleanup(true);
            //this->removeChild(pNode,true);
            iter=GNS_PlayerMgr::getInstance()->_NodeChildVec.begin();
        }
    log("%zd",GNS_PlayerMgr::getInstance()->_NodeChildVec.size());

	//for (Vector<Node*>::const_iterator it = GNS_PlayerMgr::getInstance()->_NodeHallVec.begin(); it != GNS_PlayerMgr::getInstance()->_NodeHallVec.end(); ++it) {
	//	if (*it != pNode) {
	//		(*it)->setVisible(false);
	//	}
	//	else
	//	{
	//		(*it)->setVisible(true);
	//	}
	//}

	GNS_NodeMgr::getInstance()->setMenuVisible(pNode);
}

//管理系统按钮绑定TouchEvent
void GNS_HallScene::ObtainRef()
{
    auto pCallBackBtn = static_cast<Button*>(SystemLayer->getChildByName("SysTTDetailsBtn"));
    pCallBackBtn->setTag(SYSTEM_CALLBACK);
    pCallBackBtn->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::SysteBtnCallBack, this));
    
    
    auto pUserInfox =static_cast<Button*>(SystemLayer->getChildByName("UserInfo"));
    pUserInfox->setTag(SYSTEM_USERINFOR);
    pUserInfox->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::SysteBtnCallBack, this));
    
    auto pPassWord =static_cast<Button*>(SystemLayer->getChildByName("PassWord"));
    pPassWord->setTag(SYSTEM_PASSWORLD);
    pPassWord->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::SysteBtnCallBack, this));
    
    auto pApplyForTopUp = static_cast<Button*>(SystemLayer->getChildByName("ApplyForTopUp"));
    pApplyForTopUp->setTag(SYSTEM_APPLYTOU);
    pApplyForTopUp->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::SysteBtnCallBack, this));
    
    auto pApplyForTicket = static_cast<Button *>(SystemLayer->getChildByName("ApplyForTicket"));
    pApplyForTicket->setTag(SYSTEM_APPLYTICKET);
    pApplyForTicket->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::SysteBtnCallBack, this));
    
    auto pPlayerTopUpPro =static_cast<Button*>(SystemLayer->getChildByName("PlayerTopUpPro"));
    pPlayerTopUpPro->setTag(SYSTEM_PLAYERTOPRO);
    pPlayerTopUpPro->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::SysteBtnCallBack, this));
    
    auto pPromotersTopUpPro =static_cast<Button*>(SystemLayer->getChildByName("PromotersTopUpPro"));
    pPromotersTopUpPro->setTag(SYSTEM_PROMOTERTOPRO);
    pPromotersTopUpPro->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::SysteBtnCallBack, this));
    
    auto pUserTopUp =static_cast<Button*>(SystemLayer->getChildByName("UserTopUp"));
    pUserTopUp->setTag(SYSTEM_USERTOP);
    pUserTopUp->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::SysteBtnCallBack, this));
    
    auto pGameDown =static_cast<Button*>(SystemLayer->getChildByName("GameDown"));
    pGameDown->setTag(SYSTEM_GAMEDOWN);
    pGameDown->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::SysteBtnCallBack, this));
    
    auto pManageRecord =static_cast<Button*>(SystemLayer->getChildByName("ManageRecord"));
    pManageRecord->setTag(SYSTEM_MANAGEREC);
    pManageRecord->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::SysteBtnCallBack, this));
    
    Exclamation= static_cast<ImageView*>(SystemLayer->getChildByName("Exclamation"));
    Exclamation->setVisible(false);

	this->schedule(schedule_selector(GNS_HallScene::RefreshManage), 1.0f);
}
void GNS_HallScene::ObtainPromter()
{
    if(GNS_PlayerMgr::getInstance()->getUserLevel()==0)
    {
        auto TitileText = static_cast<Text*>(Promoter->getChildByName("Text_5"));
        TitileText->setString("代理商");
        
    }
    
    auto pTopAndTick = static_cast<Button *>(Promoter->getChildByName("ApplyForTicket"));
    pTopAndTick->setTag(PROMOTER_TOPANDTICK);
    pTopAndTick->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::PromoterBtnCallBack, this));
    
    auto pAcc = static_cast<Button *>(Promoter->getChildByName("Accounted"));
    pAcc->setTag(PROMOTER_ACC);
    pAcc->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::PromoterBtnCallBack, this));
    
    auto pNew = static_cast<Button *>(Promoter->getChildByName("NewPromoter"));
    pNew->setTag(PROMOTER_NEW);
    pNew->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::PromoterBtnCallBack, this));
    
    if(GNS_PlayerMgr::getInstance()->getUserLevel()==0)
    {
        auto Text1 = static_cast<Text*>(pNew->getChildByName("Text_1"));
        Text1->setString("新增代理商");
    }
    
}

void GNS_HallScene::ObtainPlayer()  //直属玩家的控件
{
    pListView = static_cast<ListView *>(PlayerLayer->getChildByName("ListView_1"));
    
     auto pImageView =static_cast<ImageView *>(PlayerLayer->getChildByName("Image_3"));
    IDTextField = static_cast<TextField*>(pImageView->getChildByName("IDTextField"));
    auto pImageView2 =static_cast<ImageView *>(PlayerLayer->getChildByName("Image_6"));
    Exchtext = static_cast<Text*>(pImageView2->getChildByName("ExchangeText"));

	auto btnChoose = static_cast<Button *>(pImageView2->getChildByName("Button_2_0"));
	btnChoose->setTag(303);
	btnChoose->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::PlayerBtnCallBack, this));

	_IDTextField = GNS_Handler::createTMEditBoxWithExistFeild(IDTextField, pImageView, 10);
	IDTextField->setVisible(false);
    
    auto pSearch = static_cast<Button*>(pImageView->getChildByName("Button_4"));
    pSearch->setTag(304);
    pSearch->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::PlayerBtnCallBack, this));
    
    auto typrbtnSrt = static_cast<Button*>(PlayerLayer->getChildByName("Button_8_0"));
    typrbtnSrt->setTag(303);
    typrbtnSrt->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::PlayerBtnCallBack, this));
    
    Titbgplayer=static_cast<ImageView*>(PlayerLayer->getChildByName("Image_9"));
    Text_9=static_cast<Text*>(Titbgplayer->getChildByName("Text_9"));
    Text_9_0=static_cast<Text*>(Titbgplayer->getChildByName("Text_9_0"));
    
	//add by jack
	const string CZ_BTN_NAME = "Button_cz";
	const string DJ_BTN_NAME = "Button_dj";
	auto helpbtnCallback = [ = ](cocos2d::Ref *pSender, ui::Widget::TouchEventType type)
	{
		if (type != ui::Widget::TouchEventType::ENDED)
			return;

		Button *btn = (Button*)pSender;
		string btnName = btn->getName();

		pPopWnd = PopWndLayer::createScene("Calendarbg.png", "understand.png");
		auto node = pPopWnd->Loadcsb("helpLayer.csb");
		pPopWnd->GetCloseButton()->setPosition(Vec2(pPopWnd->GetPopWndSize()->getContentSize().width / 2, pPopWnd->GetPopWndSize()->getContentSize().height*0.1));
		pPopWnd->GetCloseButton()->setScale(0.7f);

		if (btnName == CZ_BTN_NAME)                          //充值说明
		{
			node->getChildByName("Text_tuiwan_cz")->setVisible(true);
			node->getChildByName("Text_wantui_dj")->setVisible(false);
		}
		else if (btnName == DJ_BTN_NAME)                    //兑奖说明
		{
			node->getChildByName("Text_tuiwan_cz")->setVisible(false);
			node->getChildByName("Text_wantui_dj")->setVisible(true);
		}
	};

	auto czhelpBtn = static_cast<Button*>(PlayerLayer->getChildByName(CZ_BTN_NAME));
	czhelpBtn->addTouchEventListener(helpbtnCallback);
	auto djhelpBtn= static_cast<Button*>(PlayerLayer->getChildByName(DJ_BTN_NAME));
	djhelpBtn->addTouchEventListener(helpbtnCallback);
    
}

void GNS_HallScene::ObtainRevRep()
{
    auto pPvpBtn = static_cast<Button*>(RevenuReport->getChildByName("ApplyForTicket"));
    pPvpBtn->setTag(REVREP_PVP);
    pPvpBtn->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::ReveBtnCallBack, this));
    
    auto pPvEBtn = static_cast<Button*>(RevenuReport->getChildByName("PVE"));
    pPvEBtn->setTag(REVREP_PVE);
    pPvEBtn->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::ReveBtnCallBack, this));
    
    auto pPveIntoBtn = static_cast<Button*>(RevenuReport->getChildByName("PVE_INTO"));
    pPveIntoBtn->setTag(REVREP_PVE_INTO);
    pPveIntoBtn->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::ReveBtnCallBack, this));
    
    auto pTopBtn = static_cast<Button*>(RevenuReport->getChildByName("Top"));
    pTopBtn->setTag(REVREP_TOP);
    pTopBtn->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::ReveBtnCallBack, this));

    auto pTickBtn = static_cast<Button*>(RevenuReport->getChildByName("Tick"));
    pTickBtn->setTag(REVREP_TICK);
    pTickBtn->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::ReveBtnCallBack, this));
    
    auto pTransferBtn = static_cast<Button*>(RevenuReport->getChildByName("TRANSFER"));
    pTransferBtn->setTag(REVREP_TRANSFER);
    pTransferBtn->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::ReveBtnCallBack, this));
}

void GNS_HallScene::PlayerDate()
{
    pListView->removeAllItems();
    _LowlineInfo.clear();
    log("pListView===%zd",pListView->getCurSelectedIndex());
    log("getloe=====%zd",GNS_PlayerMgr::getInstance()->getLowlineInfo()->size());
    for (auto it:*GNS_PlayerMgr::getInstance()->getLowlineInfo()) {
        if (it._isSupportType==0||it._isSupportType==1) {
            _LowlineInfo.push_back(it);
        }
    }
    PlayerShowDate();
}
void GNS_HallScene::PlayerShowDate(int type)
{
    pListView->removeAllItems();
    int x=0;
    Size bgSize;
	string NickNameTmp;
    for (auto it:_LowlineInfo) {
        auto bgButton = Button::create("line between1.png","line between2.png");
        bgButton->setTag(1000+x);
        bgButton->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::SelectedItemEvents, this));
        pListView->addChild(bgButton);
        bgSize = bgButton->getContentSize();
        
		NickNameTmp = SystemMgr::getInstance()->GbToUTF8(it._userNickName);
        auto NameText = Text::create(NickNameTmp, GameFontName, 24);
        NameText->setPosition(Vec2(bgSize.width*0.14, bgSize.height*0.4));
        NameText->setColor(Color3B::BLACK);
        bgButton->addChild(NameText);
        
        auto GoldText =Text::create(StringUtils::format("%lld",it._userGold), GameFontName, 24);
        GoldText->setPosition(Vec2(bgSize.width*0.35, bgSize.height*0.4));
        GoldText->setColor(Color3B::BLACK);
        bgButton->addChild(GoldText);
        
        if (type == 0)
        {
			auto TopUpText = Text::create(StringUtils::format("%lld", it._userRecharge), GameFontName, 24);
			TopUpText->setPosition(Vec2(bgSize.width*0.62, bgSize.height*0.4));
			TopUpText->setColor(Color3B::BLACK);
			bgButton->addChild(TopUpText);

			auto TickText = Text::create(StringUtils::format("%lld", it._userReward), GameFontName, 24);
			TickText->setPosition(Vec2(bgSize.width*0.84, bgSize.height*0.4));
			TickText->setColor(Color3B::BLACK);
			bgButton->addChild(TickText);
		}
		else
		{
			auto TopUpText = Text::create(StringUtils::format("%lld", it._transferIn), GameFontName, 24);
			TopUpText->setPosition(Vec2(bgSize.width*0.62, bgSize.height*0.4));
			TopUpText->setColor(Color3B::BLACK);
			bgButton->addChild(TopUpText);

			auto TickText = Text::create(StringUtils::format("%lld", it._transferOut), GameFontName, 24);
			TickText->setPosition(Vec2(bgSize.width*0.84, bgSize.height*0.4));
			TickText->setColor(Color3B::BLACK);
			bgButton->addChild(TickText);
		}

		
        x++;
    }
    pListView->setInnerContainerSize(Size(bgSize.width,(bgSize.height+10)*x));
}
void GNS_HallScene::SelectedItemEvents(cocos2d::Ref *pSender, ui::Widget::TouchEventType type)
{
    if (type==ui::Widget::TouchEventType::ENDED) {
        auto pButton = (Button*)pSender;
        int Btntag = pButton->getTag();
        int x =0;
        for (auto it:_LowlineInfo) {
            if (x==Btntag-1000) {
                NodeChoose(NullNode);
                pPlayerDate  =GNS_PlayerDate::createLayer();
                pPlayerDate->SetNodeName("PlayerDate.csb");
                CMD_CS_GetLowlinePlayerInfo pGetLowInfo;
                pGetLowInfo._promoterCode=(int)GNS_PlayerMgr::getInstance()->getMyUseridx();
                pGetLowInfo._playerId=it._userId;
                //_GameSock->sendData(MAIN_MSG_LOGIN, SUB_CS_GET_SINGLE_PLAYER_INFO, &pGetLowInfo, sizeof(pGetLowInfo));
				GnsClientFrame::getInstance()->sendMsg(0,MAIN_MSG_LOGIN, SUB_CS_GET_SINGLE_PLAYER_INFO, (char*)&pGetLowInfo, sizeof(pGetLowInfo));
                break;
            }
            x++;
        }
    }
}

//PopWndLayer * GNS_HallScene::OnUIAction(std::string Text, bool Effect)
//{
//	pPopWnd = PopWndLayer::createScene("Popwnd.png", "PageClose.png");
//	pPopWnd->setClickWndOutsideClose(true);
//	pPopWnd->SetTitleWithUTF("提示!");
//	pPopWnd->SetContentTextWithUTF(Text, Color3B::BLACK);
//	pPopWnd->GetCloseButton()->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::CallBackLogin, this));
//	return pPopWnd;
//}
void GNS_HallScene::CallBackLogin(Ref*pSender,ui::Widget::TouchEventType type)
{
    if (type==ui::Widget::TouchEventType::ENDED) {
        //_GameSock->closeConnection();
        //GnsClientFrame::getInstance()->closeSocket(0);
        GNS_SceneMgr::getInstance()->replaceScene(LOGIN_SCENE);
    }
}

void GNS_HallScene::updateRefresh(bool bFlag)
{
	Exclamation->setVisible(bFlag);
}


bool GNS_HallScene::OnHandleSocketMsg(const int &mainCmd, const int &subCmd, const void *msgData, const int &dataLen)
{
	switch (subCmd) {
	case SUB_SC_USER_CHANGE_PASSWORD_FINISH://修改密码
	case SUB_SC_USER_CHANGE_PASSWORD_ERROR://修改密码失败
	{
		assert(sizeof(CMD_SC_ChangePasswordRusult) == dataLen);
		if (sizeof(CMD_SC_ChangePasswordRusult) != dataLen)
			return false;
		CMD_SC_ChangePasswordRusult * pPassWord = (CMD_SC_ChangePasswordRusult*)(msgData);

		if (pPassWord) {
			OnUIAction2(pPassWord->szResText, false);
		}
		break;
	}
        case SUB_CSG_REQUEST_EXCHANGE_RMB_TO_GOLD_SUC://申请充值/兑奖
        {
			assert(sizeof(CMD_CSG_AppToRechageOrExchangeResult) == dataLen);
			if (sizeof(CMD_CSG_AppToRechageOrExchangeResult) != dataLen)
				return false;
            CMD_CSG_AppToRechageOrExchangeResult * pAppToReOrEx = (CMD_CSG_AppToRechageOrExchangeResult*)(msgData);
            if (pAppToReOrEx) {
                OnUIAction2(pAppToReOrEx->_mailText, false);
            }
            break;
        }
        case SUB_CSG_REQUEST_EXCHANGE_RMB_TO_GOLD_FAIL://申请充值/兑奖 失败
        {
			assert(sizeof(CMD_CSG_AppToRechageOrExchangeFail) == dataLen);
			if (sizeof(CMD_CSG_AppToRechageOrExchangeFail) != dataLen)
				return false;
			CMD_CSG_AppToRechageOrExchangeFail  *  pAppToReOrExFail =(CMD_CSG_AppToRechageOrExchangeFail*)(msgData);
            if (pAppToReOrExFail) {
                OnUIAction2(pAppToReOrExFail->_remark, false);
            }
            break;
        }
        case SUB_SC_SET_PROMOTER_RECHANGE_RATIO_SUC: //设置推广员充值比例成功
        case SUB_SC_SET_PROMOTER_RECHANGE_RATIO_FAIL://设置推广员充值比例失败
        {
			assert(sizeof(CMD_SC_SetPromoterRechargeRatioResult) == dataLen);
			if (sizeof(CMD_SC_SetPromoterRechargeRatioResult) != dataLen)
				return false;
			CMD_SC_SetPromoterRechargeRatioResult * pSetProReRation = (CMD_SC_SetPromoterRechargeRatioResult*)(msgData);
            if (pSetProReRation) {
                OnUIAction2(pSetProReRation->_remark, false);
                if (pSetProReRation->_retVal==0) {
                    //auto pHallLayer = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
                   // int InputNum = pHallLayer->pPromoterPro->SaveInput;
                    //pHallLayer->pPromoterPro->SetInputStr(StringUtils::format("%d",InputNum));
                   // pHallLayer->pPromoterPro->ResProRation();
                }
            }
            break;
        }
        case SUB_SC_GET_USER_EXCHANGE_INFO_SUC://获取个人充值、兑奖、转账查询成功
        {
			assert(sizeof(CMD_SC_GetUserExchangeInfoResult) == dataLen);
			if (sizeof(CMD_SC_GetUserExchangeInfoResult) != dataLen)
				return false;
			CMD_SC_GetUserExchangeInfoResult * pUserExInfo = (CMD_SC_GetUserExchangeInfoResult*)(msgData);

            if (pUserExInfo) {
                //GNS_PlayerMgr::getInstance()->setUserExInfoRes(pUserExInfo);
                GNS_PlayerMgr::getInstance()->setUserInfoVec(pUserExInfo);
            }
            break;
        }
        case SUB_SC_GET_USER_EXCHANGE_INFO_FAIL://获取个人充值、兑奖、转账查询失败
        {
			assert(sizeof(CMD_SC_GetUserExchangeInfoResult) == dataLen);
			if (sizeof(CMD_SC_GetUserExchangeInfoResult) != dataLen)
				return false;
			CMD_SC_GetUserExchangeInfoResult * pUesrExInfo = (CMD_SC_GetUserExchangeInfoResult*)(msgData);
            if (pUesrExInfo) {
                OnUIAction2(pUesrExInfo->_remark, false);
                auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
                pHallLayers->pUserTopUpLayer->CloserMakeLayer();
                GNS_PlayerMgr::getInstance()->getUserInfo()->clear();
            }
            break;
        }
        case SUB_SC_GET_USER_EXCHANGE_INFO_FINISH://5312 //获取个人充值、兑奖、转账查询完成
        {
            
			auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);

            pHallLayers->pUserTopUpLayer->CloserMakeLayer();
            
            break;
        }
        case SUB_SC_GET_USER_NOT_EXCHANGE_INFO_SUC://获取未领取信息成功
        {
			assert(sizeof(CMD_SC_GetUserNotExchangeInfoResult) == dataLen);
			if (sizeof(CMD_SC_GetUserNotExchangeInfoResult) != dataLen)
				return false;
			CMD_SC_GetUserNotExchangeInfoResult * pUserNotInfo = (CMD_SC_GetUserNotExchangeInfoResult*)(msgData);
            if (pUserNotInfo) {
                GNS_PlayerMgr::getInstance()->setUserNotInfo(pUserNotInfo);
            }
            break;
        }
        case SUB_SC_GET_USER_NOT_EXCHANGE_INFO_FAIL: //获取未领取信息失败
        {
            break;
        }
        case SUB_SC_GET_USER_NOT_EXCHANGE_INFO_FINISH://获取未领取信息完成
        {
            break;
        }
        case SUB_SC_GET_USER_FAIL_EXCHANGE_INFO_SUC://获取退回充值、退回兑奖信息成功
        case SUB_SC_GET_USER_FAIL_EXCHANGE_INFO_FAIL://获取退回充值、退回兑奖信息失败
        {
			assert(sizeof(CMD_SC_GetUserFailExchangeInfoResult) == dataLen);
			if (sizeof(CMD_SC_GetUserFailExchangeInfoResult) != dataLen)
				return false;
			CMD_SC_GetUserFailExchangeInfoResult * pGetUserInfo = (CMD_SC_GetUserFailExchangeInfoResult*)(msgData);
            if (pGetUserInfo) {
                GNS_PlayerMgr::getInstance()->setUserExInfo(pGetUserInfo);
            }
            break;
        }
        case SUB_SC_GET_USER_FAIL_EXCHANGE_INFO_FINISH://获取退回充值、退回兑奖信息完成
        {
            break;
        }
        case SUB_SC_SET_EXCHANGE_INFO_SUC://"领取" 或者 "退回" 充值及兑奖操作成功
        case SUB_SC_SET_EXCHANGE_INFO_FAIL://"领取" 或者 "退回" 充值及兑奖操作失败
        {
			assert(sizeof(CMD_SC_SetExchangeInfoResult) == dataLen);
			if (sizeof(CMD_SC_SetExchangeInfoResult) != dataLen)
				return false;
			CMD_SC_SetExchangeInfoResult * pSetExchangeInfo = (CMD_SC_SetExchangeInfoResult*)(msgData);
            if (pSetExchangeInfo) {
                OnUIAction2(pSetExchangeInfo->_remark, false);
                if (pSetExchangeInfo->_retVal==0) {
                    //成功
                }else{
                    //失败
                }
            }
            break;
        }
        case SUB_SC_GAME_DOWNLOAD_URL_SUC://获取游戏下载地址 成功
        {
			assert(sizeof(CMD_SC_GetGameDownLoadURLResult) == dataLen);
			if (sizeof(CMD_SC_GetGameDownLoadURLResult) != dataLen)
				return false;
			CMD_SC_GetGameDownLoadURLResult * pGameDown = (CMD_SC_GetGameDownLoadURLResult*)(msgData);
            if (pGameDown) {
                GNS_PlayerMgr::getInstance()->setGameDownUrl(pGameDown);
            }
            break;
        }
        case SUB_SC_GAME_DOWNLOAD_URL_FINISH: //获取游戏下载地址 完成
        {
            auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
            pHallLayers->pGameDow->ShowQRImage();
            
            break;
        }
        case SUB_SC_GAME_DOWNLOAD_URL_ERROR://获取游戏下载地址 失败
        {
            OnUIAction2("获取失败!", true);
            break;
        }
        case SUB_SC_AGENT_MANAGE_LOG_SUC:// //获取代理人管理记录 成功
        {
			assert(sizeof(CMD_SC_GetAgentUserManageLogResult) == dataLen);
			if (sizeof(CMD_SC_GetAgentUserManageLogResult) != dataLen)
				return false;
			CMD_SC_GetAgentUserManageLogResult * pUserManage = (CMD_SC_GetAgentUserManageLogResult*)(msgData);
            if (pUserManage) {
                GNS_PlayerMgr::getInstance()->setUserManage(pUserManage);
            }
            break;
        }
        case SUB_SC_AGENT_MANAGE_LOG_FINISH:////获取代理人管理记录 完成
        {
            auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
            pHallLayers->pManageRec->ShowManageDate();
            break;
        }
        case SUB_SC_AGENT_MANAGE_LOG_ERROR:////获取代理人管理记录 失败
        {
			assert(sizeof(CMD_SC_GetAgentUserManageLogResult) == dataLen);
			if (sizeof(CMD_SC_GetAgentUserManageLogResult) != dataLen)
				return false;
			CMD_SC_GetAgentUserManageLogResult * pUserManage = (CMD_SC_GetAgentUserManageLogResult*)(msgData);
            OnUIAction2(pUserManage->szResText, false);
            break;
        }
        case SUB_SC_GET_LOWLINE_EXCHANGE_INFO_SUC: //获取下级充值、兑奖信息成功
        {
			assert(sizeof(CMD_SC_GetExchangeListResult) == dataLen);
			if (sizeof(CMD_SC_GetExchangeListResult) != dataLen)
				return false;
			CMD_SC_GetExchangeListResult * pExListRes = (CMD_SC_GetExchangeListResult*)(msgData);
            if (pExListRes) {
                GNS_PlayerMgr::getInstance()->setExList(pExListRes);
            }
            
            break;
        }
        case SUB_SC_GET_LOWLINE_EXCHANGE_INFO_FAIL://获取下级充值、兑奖信息失败
        {
            break;
        }
        case SUB_SC_GET_LOWLINE_EXCHANGE_INFO_FINISH://获取下级充值、兑奖信息完成
        {
            auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
            pHallLayers->pTopAndTick->ShowTopTickListDate();
            break;
        }
        case  SUB_SC_GET_SINGLE_AGENT_PERCENT_SUC:  //获取单个运营商或代理商的分成占比成功
        {
			assert(sizeof(CMD_SC_GetAgentProfitPercentResult) == dataLen);
			if (sizeof(CMD_SC_GetAgentProfitPercentResult) != dataLen)
				return false;
			CMD_SC_GetAgentProfitPercentResult * pExListRes = (CMD_SC_GetAgentProfitPercentResult*)(msgData);
            if (pExListRes) {
                GNS_PlayerMgr::getInstance()->setExList1(pExListRes);
            }
            break;
        }
        case SUB_SC_GET_SINGLE_AGENT_PERCENT_FAIL://获取单个运营商或代理商的分成占比失败
        {
			assert(sizeof(CMD_SC_GetAgentProfitPercentResult) == dataLen);
			if (sizeof(CMD_SC_GetAgentProfitPercentResult) != dataLen)
				return false;
			CMD_SC_GetAgentProfitPercentResult * pExListRes = (CMD_SC_GetAgentProfitPercentResult*)(msgData);
            OnUIAction2(pExListRes->_remark, true);
            break;
        }
        case SUB_SC_GET_SINGLE_AGENT_PERCENT_FINISH: //获取单个运营商或代理商的分成占比完成
        {
            auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
            pHallLayers->pAccounter->pOperator->ShowDate();
            break;
        }
        case SUB_SC_GET_SINGLE_AGENT_INFO_SUC://获取单个代理或推广员信息成功
        {
			assert(sizeof(CMD_SC_GetSingleAgentInfoResult) == dataLen);
			if (sizeof(CMD_SC_GetSingleAgentInfoResult) != dataLen)
				return false;
			CMD_SC_GetSingleAgentInfoResult * pSingleInfo = (CMD_SC_GetSingleAgentInfoResult*)(msgData);
            if (pSingleInfo) {
                auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
                pHallLayers->pTopAndTick->pTopAndTickDivider->SetDivider(pSingleInfo);
            }
            break;
        }
        case SUB_SC_GET_SINGLE_AGENT_INFO_FAIL://获取单个代理或推广员信息失败
        {
			assert(sizeof(CMD_SC_GetSingleAgentInfoResult) == dataLen);
			if (sizeof(CMD_SC_GetSingleAgentInfoResult) != dataLen)
				return false;
			CMD_SC_GetSingleAgentInfoResult * pSingleInfo = (CMD_SC_GetSingleAgentInfoResult*)(msgData);
            if (pSingleInfo) {
                OnUIAction2(pSingleInfo->_remark, false);
            }
            break;
        }
        case SUB_SC_REQ_FORBID_AGENT_USER_SUC://封停下线代理人帐号 成功
        case SUB_SC_REQ_FORBID_AGENT_USER_ERROR://封停下线代理人帐号 失败
        {
			assert(sizeof(Req_forbid_AgentUser) == dataLen);
			if (sizeof(Req_forbid_AgentUser) != dataLen)
				return false;
			Req_forbid_AgentUser * pforbid = (Req_forbid_AgentUser*)(msgData);
            if (pforbid) {
                std::string szResText;
                if (pforbid->iRet==0) {
                    szResText="封号成功";
                    
                    auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
                    pHallLayers->pTopAndTick->pTopAndTickDivider->SetButtonState(0);
                }else{
                    szResText="封号失败";
                }
                OnUIAction2(szResText, false);
            }
            break;
        }
        case SUB_SC_REQ_UNFORBID_AGENT_USER_SUC: //解封下线代理人帐号 成功
        case SUB_SC_REQ_UNFORBID_AGENT_USER_ERROR://解封下线代理人帐号
        {
			assert(sizeof(Req_unforbid_AgentUser) == dataLen);
			if (sizeof(Req_unforbid_AgentUser) != dataLen)
				return false;
			Req_unforbid_AgentUser * pUnforbid = (Req_unforbid_AgentUser*)(msgData);
            if (pUnforbid) {
                std::string szResText;
                if (pUnforbid->iRet==0) {
                    szResText="解封成功";
                    auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
                    pHallLayers->pTopAndTick->pTopAndTickDivider->SetButtonState(1);
                }else{
                    szResText="解封失败";
                }
                OnUIAction2(szResText, false);
            }
            break;
        }
        case SUB_SC_USER_RESET_PASSWORD_FINISH:
        case SUB_SC_USER_RESET_PASSWORD_ERROR:
        {
			assert(sizeof(CMD_SC_ChangePasswordRusult) == dataLen);
			if (sizeof(CMD_SC_ChangePasswordRusult) != dataLen)
				return false;
			CMD_SC_ChangePasswordRusult * pResPassword = (CMD_SC_ChangePasswordRusult*)(msgData);
            if (pResPassword) {
                OnUIAction2(pResPassword->szResText, false);
            }
            break;
        }
        case SUB_SC_SET_SINGLE_AGENT_INFO_SUC://单个代理或推广员修改资料(备注名)成功
        {
			assert(sizeof(CMD_SC_SetSingleAgentInfoResult) == dataLen);
			if (sizeof(CMD_SC_SetSingleAgentInfoResult) != dataLen)
				return false;
			CMD_SC_SetSingleAgentInfoResult * pSetSingleInfo =(CMD_SC_SetSingleAgentInfoResult*)(msgData); 
            if (pSetSingleInfo) {
                auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
                //pHallLayers->pTopAndTick->pTopAndTickDivider->SetNewReName(pSetSingleInfo->_newRemarkName);
				map<int, string>* tmp = GNS_PlayerMgr::getInstance()->getRemarkName();
				(*tmp)[pSetSingleInfo->_promoter_id] = pSetSingleInfo->_newRemarkName;
				OnUIAction2(pSetSingleInfo->_remark, false);
            }
            break;
        }
        case SUB_SC_SET_SINGLE_AGENT_INFO_FAIL://单个代理或推广员修改资料(备注名)失败
        {
			assert(sizeof(CMD_SC_SetSingleAgentInfoResult) == dataLen);
			if (sizeof(CMD_SC_SetSingleAgentInfoResult) != dataLen)
				return false;
			CMD_SC_SetSingleAgentInfoResult * pSetSingleInfo =(CMD_SC_SetSingleAgentInfoResult*)(msgData);
            if (pSetSingleInfo) {
                OnUIAction2(pSetSingleInfo->_remark, false);
            }
            break;
        }
        case SUB_SC_GET_CURRENT_AGENT_PERCENT_SUC://获取运营商或代理商的分成占比
        {
			assert(sizeof(CMD_SC_GetAgentProfitPercentResult) == dataLen);
			if (sizeof(CMD_SC_GetAgentProfitPercentResult) != dataLen)
				return false;
			CMD_SC_GetAgentProfitPercentResult * pAgProPer = (CMD_SC_GetAgentProfitPercentResult*)(msgData);
            if (pAgProPer) {
                if (pAgProPer->_uplineCode==(int)GNS_PlayerMgr::getInstance()->getMyUseridx()) {
                    GNS_PlayerMgr::getInstance()->setAgProPer(pAgProPer);
                }else{
                    OperatorAgent=true;
                    GNS_PlayerMgr::getInstance()->setOperatorAgProPer(pAgProPer);
                }
                
            }
            break;
        }
        case SUB_SC_GET_CURRENT_AGENT_PERCENT_FINISH://获取运营商或代理商的分成占比完成
        {
            auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
            
            if (OperatorAgent==false) {
                pHallLayers->pAccounter->SetAccDate();
            }else{
                pHallLayers->pAccounter->pOperator->ShowDate();
            }
            break;
        }
        case SUB_SC_GET_CURRENT_AGENT_PERCENT_FAIL://获取运营商或代理商的分成占比失败
        {
			assert(sizeof(CMD_SC_GetAgentProfitPercentFail) == dataLen);
			if (sizeof(CMD_SC_GetAgentProfitPercentFail) != dataLen)
				return false;
			CMD_SC_GetAgentProfitPercentFail * pAgProPerFail = (CMD_SC_GetAgentProfitPercentFail*)(msgData);
            if (pAgProPerFail) {
                OnUIAction2(pAgProPerFail->_remark, false);
            }
            break;
        }
        case SUB_SC_USER_REGISTER_FINISH:// 用户注册成功
        case SUB_SC_USER_REGISTER_ERROR:// 用户注册失败
        {
			assert(sizeof(CMD_SC_AgentUserRegisterRet) == dataLen);
			if (sizeof(CMD_SC_AgentUserRegisterRet) != dataLen)
				return false;
			CMD_SC_AgentUserRegisterRet * pAgUserRes=(CMD_SC_AgentUserRegisterRet*)(msgData);
            if (pAgUserRes) {
                OnUIAction2(pAgUserRes->szResText, false);
            }
            break;
        }
        case SUB_SC_GET_LOWLINE_USER_EXCHANGE_INFO_SUC://获取玩家充兑及转账信息成功
        {
			assert(sizeof(CMD_SC_GetLowlineUserInfoResult) == dataLen);
			if (sizeof(CMD_SC_GetLowlineUserInfoResult) != dataLen)
				return false;
			CMD_SC_GetLowlineUserInfoResult * pLowlineInfo = (CMD_SC_GetLowlineUserInfoResult*)(msgData);
            if (pLowlineInfo) {
                GNS_PlayerMgr::getInstance()->setLowlineInfo(pLowlineInfo);
            }
            break;
        }
        case SUB_SC_GET_LOWLINE_USER_EXCHANGE_INFO_FAIL:
        {
			assert(sizeof(CMD_SC_GetLowlineUserInfoResult) == dataLen);
			if (sizeof(CMD_SC_GetLowlineUserInfoResult) != dataLen)
				return false;
			CMD_SC_GetLowlineUserInfoResult * pLowlineInfo = (CMD_SC_GetLowlineUserInfoResult*)(msgData);
            if (pLowlineInfo) {
                OnUIAction2(pLowlineInfo->_remark, false);
            }
            break;
        }
        case SUB_SC_GET_LOWLINE_USER_EXCHANGE_INFO_FINISH:
        {
            auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
            pHallLayers->PlayerDate();
            break;
        }
        case SUB_SC_GET_SINGLE_PLAYER_INFO_SUC://获取单个玩家信息成功
        case SUB_SC_GET_SINGLE_PLAYER_INFO_FAIL://获取单个玩家信息失败
        {
			assert(sizeof(CMD_SC_GetLowlinePlayerInfoResult) == dataLen);
			if (sizeof(CMD_SC_GetLowlinePlayerInfoResult) != dataLen)
				return false;
			CMD_SC_GetLowlinePlayerInfoResult * pGetLowlineInfo =(CMD_SC_GetLowlinePlayerInfoResult*)(msgData);
            if (pGetLowlineInfo) {
                auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
                
                pHallLayers->pPlayerDate->ShowPlayerDate(*pGetLowlineInfo);
            }
            break;
        }
        case  SUB_SC_REQ_FORBID_USER_SUC://封停下线玩家帐号 成功
        case SUB_SC_REQ_FORBID_USER_ERROR://封停下线玩家帐号 失败
        {
			assert(sizeof(Req_forbid_user) == dataLen);
			if (sizeof(Req_forbid_user) != dataLen)
				return false;
			Req_forbid_user * pForbid = (Req_forbid_user*)(msgData);
            if (pForbid->iRet==0) {
                OnUIAction2("封停玩家成功",  true);
                auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
                //pHallLayers->pPlayerDate->PlayerState=true;
                pHallLayers->pPlayerDate->SetButtonState(true);
            }else{
                OnUIAction2("封停玩家失败",  true);
            }
            break;
        }
        case SUB_SC_REQ_UNFORBID_USER_SUC://解封下线玩家帐号 成功
        case SUB_SC_REQ_UNFORBID_USER_ERROR: //解封下线玩家帐号 失败
        {
			assert(sizeof(Req_unforbid_user) == dataLen);
			if (sizeof(Req_unforbid_user) != dataLen)
				return false;
			Req_unforbid_user * pUnforbid = (Req_unforbid_user*)(msgData);
            if (pUnforbid->iRet==0) {
                OnUIAction2("解封玩家成功",  true);
                auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
                //pHallLayers->pPlayerDate->PlayerState=false;
                pHallLayers->pPlayerDate->SetButtonState(false);
            } else{
                OnUIAction2("解封玩家失败",  true);
            }
            break;
        }
        case SUB_SC_SET_USER_PRIVATE_INFO_SUC://设置个人资料成功
        case SUB_SC_SET_USER_PRIVATE_INFO_FAIL://设置个人资料失败
        {
			assert(sizeof(CMD_SC_SetUserPrivateInfoResult) == dataLen);
			if (sizeof(CMD_SC_SetUserPrivateInfoResult) != dataLen)
				return false;
			CMD_SC_SetUserPrivateInfoResult * pSetUserInfo = (CMD_SC_SetUserPrivateInfoResult*)(msgData);
            if (pSetUserInfo) {
                OnUIAction2(pSetUserInfo->_remark, false);
            }
            break;
        }
        case SUB_SC_USER_LOWER_LINE_PLAYER_RESET_PASSWORD_FINISH://下线玩家 重置密码成功
        case SUB_SC_USER_LOWER_LINE_PLAYER_RESET_PASSWORD_ERROR://下线玩家 重置密码失败
        {
			assert(sizeof(CMD_SC_ChangePasswordRusult) == dataLen);
			if (sizeof(CMD_SC_ChangePasswordRusult) != dataLen)
				return false;
			CMD_SC_ChangePasswordRusult * pChangePass = (CMD_SC_ChangePasswordRusult*)(msgData);
            if (pChangePass) {
                OnUIAction2(pChangePass->szResText, false);
            }
            break;
        }
        case SUB_SC_GET_MANTOMAN_GAME_REVENUE_SUC://人人对战收税分成成功
        {
			assert(sizeof(CMD_SC_GetManToManGameRevenueResult) == dataLen);
			if (sizeof(CMD_SC_GetManToManGameRevenueResult) != dataLen)
				return false;
			CMD_SC_GetManToManGameRevenueResult * pGetGameReven = (CMD_SC_GetManToManGameRevenueResult*)(msgData);
            if (pGetGameReven) {
                if (pGetGameReven->_belongType==0||pGetGameReven->_belongType==10||pGetGameReven->_belongType==20||pGetGameReven->_belongType==30) {
                    GNS_PlayerMgr::getInstance()->setGameReveRes(pGetGameReven);
                }else if(pGetGameReven->_belongType==11){
                    GNS_PlayerMgr::getInstance()->setGameProReveRes(pGetGameReven);
                }else if (pGetGameReven->_belongType==12||pGetGameReven->_belongType==21){
                    GNS_PlayerMgr::getInstance()->setGamePlayReveRes(pGetGameReven);
                }
            }
            break;
        }
        case SUB_SC_GET_MANTOMAN_GAME_REVENUE_FAIL://人机对战收税分成失败
        {
			assert(sizeof(CMD_SC_GetManToManGameRevenueResult) == dataLen);
			if (sizeof(CMD_SC_GetManToManGameRevenueResult) != dataLen)
				return false;
			CMD_SC_GetManToManGameRevenueResult * pGetGameReven = (CMD_SC_GetManToManGameRevenueResult*)(msgData);
            if (pGetGameReven) {
                OnUIAction2(pGetGameReven->_remark, false);
            }
            break;
        }
        case SUB_SC_GET_MANTOMAN_GAME_REVENUE_FINISH://人机对战收税分成完成
        {
			assert(sizeof(CMD_SC_GetManToManGameRevenueResult) == dataLen);
			if (sizeof(CMD_SC_GetManToManGameRevenueResult) != dataLen)
				return false;
			CMD_SC_GetManToManGameRevenueResult * pGetGameReven = (CMD_SC_GetManToManGameRevenueResult*)(msgData);
            auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
            if (pGetGameReven != nullptr) {
                if (pGetGameReven->_belongType==0||pGetGameReven->_belongType==10||pGetGameReven->_belongType==20||pGetGameReven->_belongType==30) {
                    pHallLayers->pPvpApplyTick->AcceptSeverDate();
                }else if(pGetGameReven->_belongType==11||pGetGameReven->_belongType==12||pGetGameReven->_belongType==21){
                    pHallLayers->pPvpApplyTick->SeleLayer(pGetGameReven->_belongType);
                }
            }
            break;
        }
        case SUB_CS_GET_MANTOMACH_GAME_PROFIT_SUC://获取人机对战总玩数据成功
        {
			assert(sizeof(CMD_SC_GetManToMachPlayProfitResult) == dataLen);
			if (sizeof(CMD_SC_GetManToMachPlayProfitResult) != dataLen)
				return false;
			CMD_SC_GetManToMachPlayProfitResult * pGetPlayerRes = (CMD_SC_GetManToMachPlayProfitResult*)(msgData);
            if (pGetPlayerRes) {
                if (pGetPlayerRes->_belongType==0||pGetPlayerRes->_belongType==10||pGetPlayerRes->_belongType==20||pGetPlayerRes->_belongType==30) {
                    GNS_PlayerMgr::getInstance()->setPlayProFit(pGetPlayerRes);
                }else if(pGetPlayerRes->_belongType==11){
                    GNS_PlayerMgr::getInstance()->setPlayProProFit(pGetPlayerRes);
                }else if (pGetPlayerRes->_belongType==12||pGetPlayerRes->_belongType==21){
                    GNS_PlayerMgr::getInstance()->setPlayProPlayFit(pGetPlayerRes);
                }
            }
            break;
        }
        case SUB_CS_GET_MANTOMACH_GAME_PROFIT_FAIL://获取人机对战总玩数据失败
        {
			assert(sizeof(CMD_SC_GetManToMachPlayProfitResult) == dataLen);
			if (sizeof(CMD_SC_GetManToMachPlayProfitResult) != dataLen)
				return false;
			CMD_SC_GetManToMachPlayProfitResult * pGetPlayerRes = (CMD_SC_GetManToMachPlayProfitResult*)(msgData);
            if (pGetPlayerRes) {
                OnUIAction2(pGetPlayerRes->_remark, false);
                auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
				if (pHallLayers->pPvEAllDate != nullptr)
				{
					pHallLayers->pPvEAllDate->DateListView->removeAllItems();
					if (pGetPlayerRes->_belongType == 0 || pGetPlayerRes->_belongType == 10 || pGetPlayerRes->_belongType == 20 || pGetPlayerRes->_belongType == 30) {
						pHallLayers->pPvEAllDate->AcceptSeverDate();
					}
					else if (pGetPlayerRes->_belongType == 11 || pGetPlayerRes->_belongType == 12 || pGetPlayerRes->_belongType == 21){
						pHallLayers->pPvEAllDate->SeleLayer(pGetPlayerRes->_belongType);
					}
				}
			}
            break;
        }
        case SUB_CS_GET_MANTOMACH_GAME_PROFIT_FINISH: //获取人机对战总玩数据完成
        {
			assert(sizeof(CMD_SC_GetManToMachPlayProfitResult) == dataLen);
			if (sizeof(CMD_SC_GetManToMachPlayProfitResult) != dataLen)
				return false;
			CMD_SC_GetManToMachPlayProfitResult * pGetPlayerRes = (CMD_SC_GetManToMachPlayProfitResult*)(msgData);
            if (pGetPlayerRes) {
                auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
                if (pGetPlayerRes->_belongType==0||pGetPlayerRes->_belongType==10||pGetPlayerRes->_belongType==20||pGetPlayerRes->_belongType==30) {
                    pHallLayers->pPvEAllDate->AcceptSeverDate();
                }else if(pGetPlayerRes->_belongType==11||pGetPlayerRes->_belongType==12||pGetPlayerRes->_belongType==21){
                    pHallLayers->pPvEAllDate->SeleLayer(pGetPlayerRes->_belongType);
                }
            }
            
            
            break;
        }
        case SUB_SC_GET_MANTOMACH_GAME_PROFIT_RATIO_SUC://获取人机对战总玩分成成功
        {
			assert(sizeof(CMD_SC_GetManToMachPlayProfitRatioResult) == dataLen);
			if (sizeof(CMD_SC_GetManToMachPlayProfitRatioResult) != dataLen)
				return false;
			CMD_SC_GetManToMachPlayProfitRatioResult * pGetPlayeRation = (CMD_SC_GetManToMachPlayProfitRatioResult*)(msgData);
            if (pGetPlayeRation) {
                if (pGetPlayeRation->_belongType==11) {
                    GNS_PlayerMgr::getInstance()->setPlayProProRation(pGetPlayeRation);
                }else{
                    GNS_PlayerMgr::getInstance()->setPlayProRation(pGetPlayeRation);
                }
            }
            break;
        }
        case SUB_SC_GET_MANTOMACH_GAME_PROFIT_RATIO_FAIL://获取人机对战总玩分成失败
        {
			assert(sizeof(CMD_SC_GetManToMachPlayProfitRatioResult) == dataLen);
			if (sizeof(CMD_SC_GetManToMachPlayProfitRatioResult) != dataLen)
				return false;
			CMD_SC_GetManToMachPlayProfitRatioResult * pGetPlayeRation = (CMD_SC_GetManToMachPlayProfitRatioResult*)(msgData);
            if (pGetPlayeRation) {
                OnUIAction2(pGetPlayeRation->_remark, false);
            }
            break;
        }
        case SUB_SC_GET_MANTOMACH_GAME_PROFIT_RATIO_FINISH://获取人机对战总玩分成完成
        {
			assert(sizeof(CMD_SC_GetManToMachPlayProfitRatioResult) == dataLen);
			if (sizeof(CMD_SC_GetManToMachPlayProfitRatioResult) != dataLen)
				return false;
			CMD_SC_GetManToMachPlayProfitRatioResult * pGetPlayeRation = (CMD_SC_GetManToMachPlayProfitRatioResult*)(msgData);
            if (pGetPlayeRation) {
                auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
                if (pGetPlayeRation->_belongType==11) {
                    pHallLayers->pPvEAllInfo->SeleLayer(11);
                }else{
                    pHallLayers->pPvEAllInfo->AcceptSeverDate();
                }
            }
            break;
        }
        case SUB_SC_GET_DIALY_EXCHANGE_INFO_SUC://获取每日兑换信息(充值 兑奖 转账)成功
        {
			assert(sizeof(CMD_SC_GetDialyExchangeInfoResult) == dataLen);
			if (sizeof(CMD_SC_GetDialyExchangeInfoResult) != dataLen)
				return false;
			CMD_SC_GetDialyExchangeInfoResult * pGetDialyInfo = (CMD_SC_GetDialyExchangeInfoResult*)(msgData);
            if (pGetDialyInfo) {
                if (pGetDialyInfo->_operType==1) {
                    GNS_PlayerMgr::getInstance()->InfoResult_operType=1;
                    GNS_PlayerMgr::getInstance()->setDialyToInfo(pGetDialyInfo);
                }else if (pGetDialyInfo->_operType==2)
                {
                    GNS_PlayerMgr::getInstance()->InfoResult_operType=2;
                    GNS_PlayerMgr::getInstance()->setDialyTiInfo(pGetDialyInfo);
                }else if (pGetDialyInfo->_operType==3){
                    GNS_PlayerMgr::getInstance()->InfoResult_operType=3;
                    GNS_PlayerMgr::getInstance()->setDialyTrInfo(pGetDialyInfo);
                }
            }
            break;
        }
        case SUB_SC_GET_DIALY_EXCHANGE_INFO_FAIL://获取每日兑换信息(充值 兑奖 转账)失败
        {
			assert(sizeof(CMD_SC_GetDialyExchangeInfoResult) == dataLen);
			if (sizeof(CMD_SC_GetDialyExchangeInfoResult) != dataLen)
				return false;
			CMD_SC_GetDialyExchangeInfoResult * pGetDialyInfo = (CMD_SC_GetDialyExchangeInfoResult*)(msgData);
            if (pGetDialyInfo) {
                OnUIAction2(pGetDialyInfo->_remark, false);
            }
            auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
            if (GNS_PlayerMgr::getInstance()->InfoResult_operType==1)
            {
                pHallLayers->pDailyTop->DateListView->removeAllItems();
            }else if (GNS_PlayerMgr::getInstance()->InfoResult_operType==2)
            {
                pHallLayers->pDailyTick->DateListView->removeAllItems();
            }else if (GNS_PlayerMgr::getInstance()->InfoResult_operType==3)
            {
                pHallLayers->pDailyTransfer->DateListView->removeAllItems();
            }
            break;
        }
        case SUB_SC_GET_DIALY_EXCHANGE_INFO_FINISH://获取每日兑换信息(充值 兑奖 转账)完成
        {
            auto pHallLayers = (GNS_HallScene*)GNS_SceneMgr::getInstance()->getSceneLayer(HALL_LAYER);
            if (GNS_PlayerMgr::getInstance()->InfoResult_operType==1)
            {
                pHallLayers->pDailyTop->AcceptSeverDate();
            }else if (GNS_PlayerMgr::getInstance()->InfoResult_operType==2)
            {
                pHallLayers->pDailyTick->AcceptSeverDate();
            }else if (GNS_PlayerMgr::getInstance()->InfoResult_operType==3)
            {
                pHallLayers->pDailyTransfer->AcceptSeverDate();
            }
            break;
        }
		case SUB_SC_USER_GETUSERINFO_FINISH: //获取个人信息
		{
			 assert(sizeof(CMD_SC_GetMobileUserinfoResult) == dataLen);
			 if (sizeof(CMD_SC_GetMobileUserinfoResult) != dataLen)
				 return false;

			 CMD_SC_GetMobileUserinfoResult * pUserinfo = (CMD_SC_GetMobileUserinfoResult*)(msgData);
			 if (pUserinfo)
			 {
				 GNS_PlayerMgr::getInstance()->pGetUserInfoResult = *pUserinfo;
				 NodeChoose(NullNode);
				 pUserInfo = GNS_PopWndUserInfo::createLayer();
				 pUserInfo->SetNodeName("UserInfoLayer.csb");
				 pUserInfo->UserInfoDate(GNS_PlayerMgr::getInstance()->pGetUserInfoResult);
			 }
			 break;
		}
		case SUB_SC_USER_GETUSERINFO_ERROR: //获取个人信息失败
		{
			 assert(sizeof(CMD_SC_GetAgentUserInfoFail) == dataLen);
			 if (sizeof(CMD_SC_GetAgentUserInfoFail) != dataLen)
				 return false;

			 CMD_SC_GetAgentUserInfoFail * pUserInfoFail = (CMD_SC_GetAgentUserInfoFail*)(msgData);
			 if (pUserInfoFail)
			 {
				 OnUIAction2(pUserInfoFail->szResText, false);
			 }
			 break;
		}
		case SUB_SC_AGENT_USER_KICKOUT: //重复登陆
		{
			 auto popwnd = PopWndLayer::createScene("Popwnd.png");
			 popwnd->setClickWndOutsideClose(true);
			 popwnd->SetTitleWithUTF("提示!");
			 popwnd->SetContentTextWithUTF("账号在其他设备上登陆！", Color3B::BLACK);
			 popwnd->AddCallBack([](Touch* t, Event* e)
			 {
				 GnsClientFrame::getInstance()->closeSocket(0);
				 GNS_PlayerMgr::getInstance()->ClearAllVectorDate();
				 GNS_SceneMgr::getInstance()->replaceScene(LOGIN_SCENE);
			 });
			 
			 break;
		}
			
        default:  
			break;
    }
}
// 事件桥定时器的回调函数
void GNS_HallScene::onEventBridge(float dt)
{
    IEventBridge::EVENT_INFO eventInfo;
    
    while (IEventBridge::getInstance()->popFront(eventInfo) )
    {
		switch (eventInfo.iMainCode)
		{
		case CLIENT_INNER_RE_CONNECT:			// 断线重连
		{
			int& iReconnectCount = (int&)eventInfo.szBody;
			reConnectResult(eventInfo.iClientId, eventInfo.iSubCode, iReconnectCount);
			break;
		}
		case CLIENT_INNER_RE_CLOSE:		// 断线
		{
			// 断线时不需要作任何处理，断线的事项交由断线重连功能（CLIENT_INNER_RE_CONNECT）进行处理
			break;
		}
		default:
		{
			OnHandleSocketMsg(eventInfo.iMainCode, eventInfo.iSubCode, &eventInfo.szBody, eventInfo.iBodyLen);
			break;
		}


			//case SUB_SC_USER_GETUSERINFO_FINISH:
			//    
			//case SUB_SC_USER_GETUSERINFO_ERROR:
			//case SUB_SC_GET_LOWLINE_RECHARGE_RATIO_SUC:
			//case SUB_SC_GET_LOWLINE_RECHARGE_RATIO_FAIL:
			//case SUB_SC_GET_LOWLINE_RECHARGE_RATIO_FINISH:
			//case SUB_SC_GET_REMARK_NAME_SUC:
			//case SUB_SC_GET_REMARK_NAME_FAIL:
			//case SUB_SC_GET_REMARK_NAME_FINISH:
			//case SUB_SC_GAME_HALL_LIST_SUCC:
			//case SUB_SC_GAME_HALL_LIST_ERROR:
			//case SUB_SC_GAME_HALL_LIST_FINISH:
			//case SUB_SG_VERSION_REEOR:
			//case SUB_SC_USER_LOGIN_SUC:
			//case SUB_SC_USER_LOGIN_FINISH:
			//case SUB_SC_USER_LOGIN_FAIL:
		}
    }
}

PopWndLayer * GNS_HallScene::OnUIAction2(std::string Text,bool isUTF)
{
    pPopWnd = PopWndLayer::createScene("Popwnd.png", "PageClose.png");
    pPopWnd->setClickWndOutsideClose(true);
    pPopWnd->SetTitleWithUTF("提示!");
	if (isUTF)
		pPopWnd->SetContentTextWithUTF(Text, Color3B::BLACK);
	else
		pPopWnd->SetContentTextWithGB(Text, Color3B::BLACK);
    return pPopWnd;
}

// 断线重连
int GNS_HallScene::reConnectResult(int iClientId, int iSubCode, int iReconnectCount)
{
	switch (iSubCode)
	{
		case RECC_START_NO_CIRCLE:				// 在 开始转圈的连接次数 以内，不转圈
		{
			log("CLIENT_INNER_RE_CONNECT,  RECC_START_NO_CIRCLE  %d", iReconnectCount);
			break;
		}
		case RECC_CONNECT_CIRCLE_ING:	// 在  >开始转圈的连接次数 并且  <=结束转圈的连接次数 范围，开始转圈【正在连接】
		{
			log("CLIENT_INNER_RE_CONNECT, RECC_CONNECT_CIRCLE_ING  %d", iReconnectCount);
			if (pInfoMakeLayer == nullptr)
			{
				pInfoMakeLayer = GNS_MakeLayer::CreateMakeLayer("正在连接...");
				addMakerLayer();
			}
			break;
		}
		case RECC_SUCC_NO_CIRCLE:			// 连接成功，结束转圈
		{
			log("CLIENT_INNER_RE_CONNECT,  RECC_SUCC_NO_CIRCLE  %d", iReconnectCount);
			if (pInfoMakeLayer != nullptr)
			{
				pInfoMakeLayer->Show(false);
				flag = true;
			}
			break;
		}
		case RECC_FAIL_NO_CIRCLE:				// 结束转圈，并弹出【连接失败】的提示框
		{
			log("CLIENT_INNER_RE_CONNECT,  RECC_FAIL_NO_CIRCLE  %d", iReconnectCount);
			if (pInfoMakeLayer != nullptr)
			{
				pInfoMakeLayer->Show(false);
				flag = true;
			}
			// 连接失败的提示框
		
			this->unschedule(schedule_selector(GNS_HallScene::onEventBridge));
			//log("连接失败");

		
			auto  pPopWnd = PopWndLayer::createScene("Popwnd.png", "PageClose.png");
			//pPopWnd->setClickWndOutsideClose(true);
			pPopWnd->SetTitleWithUTF("提示!");
			pPopWnd->SetContentTextWithUTF("与服务器连接失败，请重试！", Color3B::BLACK);
			auto btn = pPopWnd->GetCloseButton();
			btn->setPosition(Vec2(pPopWnd->GetPopWndSize()->getContentSize().width / 2, pPopWnd->GetPopWndSize()->getContentSize().height*0.1));
			btn->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::closeConnectCallBack, this));

			break;
		}
	}

	return 0;
}
void GNS_HallScene::closeConnectCallBack(cocos2d::Ref *pSender, ui::Widget::TouchEventType type)
{
	if (type == ui::Widget::TouchEventType::ENDED) 
	
		GNS_SceneMgr::getInstance()->replaceScene(LOGIN_SCENE);
}

void GNS_HallScene::addMakerLayer()
{
	if (!flag)
	{
		this->addChild(pInfoMakeLayer);
		flag = true;
	}
}

void GNS_HallScene::playerSearchFunc()
{
	//std::string textstr = SystemMgr::getInstance()->utf8ToGb(IDTextField->getString().c_str());
	std::string textstr = SystemMgr::getInstance()->utf8ToGb(_IDTextField->getText());
	log("%s", textstr.c_str());
	int Input = atoi(textstr.c_str());
	if (textstr.length() != 0) {
		bool IsSearch = false;
		int x = 0;
		for (auto it : _LowlineInfo) {
			if (it._userNickName == textstr || it._userId ==Input ) {
				IsSearch = true;
				pListView->removeAllItems(); // 玩家的ListView 清空所有的数据
				tempSearchVector.clear();  // 搜索 到的数据，存放在临时的容器中
				tempSearchVector.push_back(it);  //_AgProPer
				refreshList(it, x);  //RefreshList
			}
			x++;
		}
		if (IsSearch == false) {
			popSearchTips();
			//SetAccDate();
			searchSingleListView();
		}
	}
	else{
		popSearchTips();
		//SetAccDate();
		searchSingleListView();
	}
}

void GNS_HallScene::refreshList(CMD_SC_GetLowlineUserInfoResult it, int x)
{
	auto bgButton = Button::create("line between1.png","line between2.png");
	bgButton->setTag(1000+x);
	bgButton->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::SelectedItemEvents, this));
	pListView->addChild(bgButton);
	auto bgSize = bgButton->getContentSize();

	string NickNameTmp = SystemMgr::getInstance()->gbkToUTF8(it._userNickName);
	auto NameText = Text::create(NickNameTmp, GameFontName, 24);
	NameText->setPosition(Vec2(bgSize.width*0.14, bgSize.height*0.4));
	NameText->setColor(Color3B::BLACK);
	bgButton->addChild(NameText);

	auto GoldText =Text::create(StringUtils::format("%lld",it._userGold), GameFontName, 24);
	GoldText->setPosition(Vec2(bgSize.width*0.35, bgSize.height*0.4));
	GoldText->setColor(Color3B::BLACK);
	bgButton->addChild(GoldText);

	auto TopUpText = Text::create(StringUtils::format("%lld",it._userRecharge), GameFontName, 24);
	TopUpText->setPosition(Vec2(bgSize.width*0.62, bgSize.height*0.4));
	TopUpText->setColor(Color3B::BLACK);
	bgButton->addChild(TopUpText);

	auto TickText = Text::create(StringUtils::format("%lld",it._userReward), GameFontName, 24);
	TickText->setPosition(Vec2(bgSize.width*0.84, bgSize.height*0.4));
	TickText->setColor(Color3B::BLACK);
	bgButton->addChild(TickText);
	
}

void GNS_HallScene::popSearchTips()
{
	auto pPopWnd = PopWndLayer::createScene("Popwnd.png", "PageClose.png");
	pPopWnd->setClickWndOutsideClose(true);
	pPopWnd->SetTitleWithUTF("提示!");
	pPopWnd->SetContentTextWithUTF("没有搜索到", Color3B::BLACK);
}

void GNS_HallScene::searchSingleListView()  //SetAccDate
{

	for (auto it : _LowlineInfo) {
		tempSearchVector.push_back(it);  //_AgProPer
	}
	pListView->removeAllItems();
	int x = 0;
	Size bgSize;
	string NickNameTmp;
	for (auto it : _LowlineInfo) {
		auto bgButton = Button::create("line between1.png", "line between2.png");
		bgButton->setTag(1000 + x);
		bgButton->addTouchEventListener(CC_CALLBACK_2(GNS_HallScene::SelectedItemEvents, this));
		pListView->addChild(bgButton);
		bgSize = bgButton->getContentSize();

		NickNameTmp = SystemMgr::getInstance()->GbToUTF8(it._userNickName);
		auto NameText = Text::create(NickNameTmp, GameFontName, 24);
		NameText->setPosition(Vec2(bgSize.width*0.14, bgSize.height*0.4));
		NameText->setColor(Color3B::BLACK);
		bgButton->addChild(NameText);

		auto GoldText = Text::create(StringUtils::format("%lld", it._userGold), GameFontName, 24);
		GoldText->setPosition(Vec2(bgSize.width*0.35, bgSize.height*0.4));
		GoldText->setColor(Color3B::BLACK);
		bgButton->addChild(GoldText);

		auto TopUpText = Text::create(StringUtils::format("%lld", it._userRecharge), GameFontName, 24);
		TopUpText->setPosition(Vec2(bgSize.width*0.62, bgSize.height*0.4));
		TopUpText->setColor(Color3B::BLACK);
		bgButton->addChild(TopUpText);

		auto TickText = Text::create(StringUtils::format("%lld", it._userReward), GameFontName, 24);
		TickText->setPosition(Vec2(bgSize.width*0.84, bgSize.height*0.4));
		TickText->setColor(Color3B::BLACK);
		bgButton->addChild(TickText);
		x++;
	}
	if (bgSize.width != 0 || bgSize.height != 0) {
		pListView->setInnerContainerSize(Size(bgSize.width, (bgSize.height + 10)*x));
	}
}

void GNS_HallScene::setSwallowsTouches(bool swallowsTouches)
{
	auto dispatcher = Director::getInstance()->getEventDispatcher();
	auto listener = EventListenerTouchOneByOne::create();
	listener->onTouchBegan = [](Touch *, Event *){return true; };
	listener->onTouchEnded = [](Touch *, Event *){return; };
	listener->setSwallowTouches(swallowsTouches);//true不向下传递触摸,false向下传递触摸
	dispatcher->addEventListenerWithSceneGraphPriority(listener, pSptbg);
}